﻿<cfsilent>
	<cfscript>
		
		dictAdvice = getProperty("serviceFactory").getBean("senateDictionaryAdvice");
		
		termId = event.getArg("TermID");
		academicYear = event.getArg("AcademicYear");
		academicTerm = event.getArg("AcademicTerm");
		
		taskId = event.getArg("TSK");
		taskType = event.getArg("TT");

		docId = event.getArg("DOCID");
		
		switch(taskType){
			case "C":
				sql = "SELECT 
							t_course.course_name, 
							a.task_week, 
							t_teacher.tch_name, 
							t_institute.institute_name, 
							t_course.course_credit, 
							t_teacher.tch_id, 
							a.task_period 
						FROM 
							t_common_task a 
							INNER JOIN t_course ON t_course.cid = a.cid 
							INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
							INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
						WHERE 
							a.tsk_id = :taskId ";
				break;

			case "P":
				sql = "SELECT 
							t_course.course_name, 
							a.task_week, 
							t_teacher.tch_name, 
							t_institute.institute_name, 
							t_course.course_credit, 
							t_teacher.tch_id, 
							a.task_period 
						FROM 
							t_task a 
							INNER JOIN t_course ON t_course.cid = a.cid 
							INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
							INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
						WHERE 
							a.tsk_id = :taskId ";
				break;
			
			case "R":
				sql = "SELECT 
							t_course.course_name, 
							a.task_week, 
							t_teacher.tch_name, 
							t_institute.institute_name, 
							t_course.course_credit, 
							t_teacher.tch_id, 
							a.task_period 
						FROM 
							t_reopen_task a 
							INNER JOIN t_course ON t_course.cid = a.cid 
							INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
							INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
						WHERE 
							a.tsk_id = :taskId ";
				break;
			
			case "T":
				sql = "SELECT 
							t_course.course_name, 
							a.task_week, 
							t_teacher.tch_name, 
							t_institute.institute_name, 
							t_course.course_credit, 
							t_teacher.tch_id, 
							a.task_period 
						FROM 
							t_sport_task a 
							INNER JOIN t_course ON t_course.cid = a.cid 
							INNER JOIN t_institute ON t_institute.institute_id = t_course.institute_id 
							INNER JOIN t_teacher ON t_teacher.tch_id = a.tch_id 
						WHERE 
							a.tsk_id = :taskId ";
				break;
		}
		
		queryObj = new query( datasource=application.dnsSlave );
		queryObj.addParam( name="taskId", value=taskId, cfsqltype="cf_sql_varchar" );
		rs_task = queryObj.execute( sql=sql ).getResult();
		
		sql = "SELECT change_desc, change_type FROM t_task_adjust WHERE sign_id = :docId ";
		
		queryObj = new query( datasource=application.dnsSlave );
		queryObj.addParam( name="docId", value=docId, cfsqltype="cf_sql_char" );
		rs_taskAdjust = queryObj.execute( sql=sql ).getResult();

		event.setArg("pageTitle", "教学任务安排 - 临时调换教室 - " & rs_task.course_name );
		
	</cfscript>
</cfsilent>

<div id="headArea">
	<div class="uiHeader uiHeaderWithImage ptm">
		<div class="clearfix uiHeaderTop">
			<div class="uiHeaderActions rfloat">
				<a class="uiButton" href="<cfoutput>#buildURL('taskTempChange')#</cfoutput>"><i class="mrs img btnList"></i><span class="uiButtonText">临时性调停课</span></a>
			</div>
			<div>
				<h2 class="uiHeaderTitle">
					<i class="uiHeaderImage img icon16x16 card"></i>临时调换教室 <cfoutput>#rs_task.course_name#</cfoutput>-<cfoutput>#rs_task.tch_name#</cfoutput> 
				</h2>
			</div>
		</div>
	</div>
</div>

<!--- 加载导航菜单 --->
<!-- stepMenu-->
<cfoutput>#event.getArg("stepMenu")#</cfoutput>
<!--/stepMenu-->

<div class="UIElement">
	<ul class="senateFirstPage">
		<li>
			<div class="clearfix" id="summary">

				<div class="noticeBlock">
					<h3><cfoutput>#rs_task.course_name#</cfoutput> - <cfoutput>#rs_task.tch_name#</cfoutput></h3>
					<p>
						<span class="img icon16x16 message"></span>
						该教学任务换教室操作已完成. <cfoutput>#rs_taskAdjust.change_desc#</cfoutput>
					</p>
					<hr/>
				</div>
				
				<div class="UIDashBoard">
						
					<div class="col2">
						
						<div class="noticeBlock">
							<p><cfoutput>#rs_task.course_name#</cfoutput></p>
							<ol>
								<li>学分: <strong><cfoutput>#numberFormat(rs_task.course_credit, '_.00')#</cfoutput></strong> 排课周次: <strong><cfoutput>#rs_task.task_week#</cfoutput></strong> 周学时: <strong><cfoutput>#rs_task.task_period#</cfoutput></strong></li>
								<li>任课单位: <cfoutput>#rs_task.institute_name#</cfoutput></li>
								<li>教师: <cfoutput>#rs_task.tch_name#</cfoutput> <strong>(<cfoutput>#rs_task.tch_id#</cfoutput>)</strong></li>
								<li><cfoutput>#rs_taskAdjust.change_desc#</cfoutput></li>
							</ol>
						</div>
						
					</div>

					<div class="col2 last">
						
						<div class="noticeBlock">
							<p>调教室回执单号</p>
							<p>
								<span class="img icon16x16 message"></span>
								该回执单号仅用于核查教师更换教学场地信息
							</p>
							<br/>
							<p><img src="<cfoutput>#getContextRoot()#</cfoutput>/barcode/Progress/TK-<cfoutput>#rs_taskAdjust.change_type#</cfoutput>-<cfoutput>#docId#</cfoutput>.png" /></p>
							
						</div>
						
					</div>
				
				</div>

			</div>
		</li>
	</ul>
</div>
